<script language="javascript">
$(document).ready(function() {ldelim}	
	$('form').submit(function() {ldelim}
		CKupdate();	
		var url = $(this).attr('action');
		var data = $(this).serialize();	
		if ($('#id_cat').val() == ''){ldelim}
			execute('', '', 'Категория успешно добавлена', url, '', data, function(){ldelim}updateHash('tab3-1tab'); setupHash('widget2');{rdelim});
		{rdelim}else{ldelim}
			execute('', '', 'Категория успешно отредактирована', url, '', data, function(){ldelim}updateHash('tab3-1tab'); setupHash('widget2');{rdelim});
		{rdelim}
		return false;
	{rdelim});
	
	
	$("#translit").click(function(){ldelim}
		$.ajax({ldelim}
			beforeSend: function(){ldelim}
				$("#checkResult").html('');
				{rdelim},
			url:'index.php',
			data: ({ldelim}action: 'modedit','moduleaction':'translit','do': 'modules','mod': 'shop',cp: '{$sess}',title: $("#name").val(){rdelim}),
			timeout:3000,
			success: function(data){ldelim}
				$("#category_alias").val(data);
				{rdelim}
		{rdelim});
	{rdelim});	
	
	
	
	
	
	
	
{rdelim});

</script>





<br/>
<h4 class="pagetitle">Добавить новую категорию</h4>
<br/>

<form action="index.php?do=modules&action=modedit&mod=shop&moduleaction=edit_categ&cp={$sess}&pop=1&Id={$smarty.request.Id}&sub=save" method="post" class="mainForm">
	<div class="hash"></div>
	<input type="hidden" value="{$row->Id}" name="id_cat" id="id_cat">	
	<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
		<col width="250" valign="top" class="first">
		<col class="second">
		<thead>
		<tr>
			<td width="250">{#SettingsName#}</td>
			<td>{#SettingsValue#}</td>
		</tr>
		</thead>
		<tr>
			<td>{#SShipperName#}</td>
			<td>
				<div class="pr12"><input style="width:100%" type="text" name="category_name" id="name" value="{$row->category_name|escape:html|stripslashes}" /></div>
			</td>
		</tr>
		<tr>
			<td class="first">{#ProductCategsParent#}</td>
			<td>
				<div class="pr12"><select style="width:250px" name="category_parent">
					<option value="0">{#ProductCategsNoParent#}</option>
					{foreach from=$ProductCategs item=pc}
						{if $pc->Id != $row->Id}<option value="{$pc->Id}" {if $pc->Id == $row->category_parent}selected="selected"{/if}>{$pc->expander}{$pc->category_name|escape:html|stripslashes}</option>{/if}
					{/foreach}
				</select></div>
			</td>
		</tr>
		<tr>
			<td class="first">Описание сверху</td>
			<td>
				{$category_description}
			</td>
		</tr>
		<tr>
			<td class="first">Описание снизу</td>
			<td>
				{$category_description2}
			</td>
		</tr>
		<tr>
			<td>{#Position#}</td>
			<td>
				<div class="pr12"><input name="PosiStartseite" type="text" value="{$row->PosiStartseite}" size="10" maxlength="4" /></div>
			</td>
		</tr>
		
		<tr>
			<td>Ссылка для вызова рубрики</td>
			<td>
				<div class="pr12"><input type="text" style="width: 75%;" id="category_alias" name="category_alias" value="{$row->category_alias}" /><input type="button" style="margin-left: 10px;" class="basicBtn topDir" id="translit" value="Сформировать" /></div>
			  <span id="loading" style="display:none">&nbsp;&nbsp;&nbsp;<img src="{$tpl_dir}/js/jquery/images/ajax-loader-green.gif"  border="0" /></span>
			  <span id="checkResult"></span>
			</td>
		</tr>
		
		
		<tr>
			<td class="first">{#ProductNewImage#}</td>
			<td>
				{*<input name="category_image" size="68" type="file" id="category_image" />*}
				<a href="{$row->category_image}" target="_blank"><img border='0' align='left' alt='' width="80" id="preview__category_image" src='{$row->category_image_thumb}' style='padding: 2px 2px 0pt 0px;'></a>
<div class="clear" style="height:5px"></div>
				<input style="width:50%" name="category_image" type="text" id="category_image" value="{$row->category_image|escape}" /> 
				<input value="выбрать" class="basicBtn topDir" onclick="openFileWindow('category_image','category_image');" type="button">
			</td>
		</tr>

		<tr>
			<td>bid</td>
			<td>
				<div class="pr12"><input name="bid" type="text" value="{$row->bid}" size="10" maxlength="5" /></div>
			</td>
		</tr>

		<tr>
			<td>cbid</td>
			<td>
				<div class="pr12"><input name="cbid" type="text" value="{$row->cbid}" size="10" maxlength="5" /></div>
			</td>
		</tr>
	</table>
	<div class="rowElem">
	<input class="basicBtn topDir" type="submit" value="{#ButtonSave#}" />
	</div>
</form>
<br/>

	
	
{*	
<div class="widget first">
<div class="head"><h5>Свойства группы</h5></div>
	<div style="padding:20px">	






<INPUT TYPE="hidden" value="{$smarty.request.Id}" name="group_id">
<INPUT TYPE="hidden" value="2" name="step">	
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
	<thead>
	<tr height="20">
		<td class="tableheader" width=1>Выбрать</td>
		<td class="tableheader" width=1>Краткий поиск</td>
		<td class="tableheader" width=1>Расширенный поиск</td>
		<td class="tableheader" width=50>Диапазон</td>
		<td class="tableheader" width=50>Порядок</td>
		<td class="tableheader" width=50>Кр.вывод</td>
		<td class="tableheader" width=80 align="center">Порядок кр. вывода</td>
		<td class="tableheader">Свойство</td>
		<td class="tableheader" width=1>Префикс</td>
		<td class="tableheader" width=1>Суффикс</td>
		<td class="tableheader" width=1>Глобальная</td>
	</tr>
	</thead>	
{foreach from=$prps item=prps}
	<tr>
		<td width=5 align=center><INPUT class="checkb" TYPE="checkbox" value="{$prps->prt_id}" id="prty{$prps->prt_id}" name="group[]"  onClick="onClickPrty(this, '{$prps->prt_id}');"  {$prps->checked}></td>
		<td width=5 align=center><INPUT class="checkb" TYPE="checkbox" value="{$prps->prt_id}" id="search_small{$prps->prt_id}" name="search_small[]"  onClick="onClickSearch_small(this, '{$prps->prt_id}');" {$prps->search_small_checked}>&nbsp;</td>
		<td width=5 align=center><INPUT class="checkb" TYPE="checkbox" value="{$prps->prt_id}" id="search{$prps->prt_id}" name="search[]"  onClick="onClickSearch(this, '{$prps->prt_id}');" {$prps->search_checked}>&nbsp;</td>
		<td width=5 align=center><INPUT class="checkb" TYPE="checkbox" value="{$prps->prt_id}" id="PosiStartseitee{$prps->prt_id}" name="PosiStartseitee[]" onClick="onClickPosiStartseitee(this, '{$prps->prt_id}');" {$prps->PosiStartseitee_checked}>&nbsp;</td>
		<td><input type="text" size="2" name="ord[{$prps->prt_id}]" value="{$prps->prt_ord}"></td>
		<td width=5 align=center><INPUT class="checkb" TYPE="checkbox" value="{$prps->prt_id}" id="item_small{$prps->prt_id}" name="item_small[]" {$prps->item_small_checked}>&nbsp;</td>
		<td><input type="text" size="2" name="item_small_ord[{$prps->prt_id}]" value="{$prps->prt_item_small_ord}"></td>
		<td>{$prps->prt_name}</td>
		<td>{$prps->prt_prefix}</td>
		<td>{$prps->prt_suffix}</td>
		<td>
			<select name="global[{$prps->prt_id}]">
				<option value="" {if ''==$prps->global}selected="selected"{/if}>-- не учитывать --</option>

				<option value="razmer" {if 'razmer'==$prps->global} selected="selected"{/if}>Размер</option>
			</select>		
		</td>
	</tr>
{/foreach}



</table>

	
	
	
	<input class="button" type="submit" value="{#ButtonSave#}" />
</form>

</div>
</div>
	 <div class="fix"></div>	
*}




	 
	 